package com.zdxlz.fcmp.common.mybatis.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description：IPSec模板配置表【IPSec封包协议】枚举类
 * @Author： aman
 * @Date： 2025/2/8 11:14
 */
@Getter
@AllArgsConstructor
public enum IpsecTransformEnum {
    IPSEC_AH(1, "AH"),
    IPSEC_ESP(2, "ESP"),
    ;
    @EnumValue
    private final Integer code;
    private final String name;

    public static IpsecTransformEnum getByCode(Integer code) {
        for (IpsecTransformEnum ipsecTransformEnum : IpsecTransformEnum.values()) {
            if (ipsecTransformEnum.getCode() == code) {
                return ipsecTransformEnum;
            }
        }
        return null;
    }

    @JsonValue
    public int getCode() {
        return code;
    }
}
